{% extends  'admin/layout.html' %}
{% import 'common/page.html' as pg %}
{% block content %}
        <section class="content-header">
            <h1>微电影管理系统</h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 电影管理</a></li>
                <li class="active">电影列表</li>
            </ol>
        </section>
        <section class="content" id="showcontent">
            <div class="row">
                <div class="col-md-12">
                    <div class="box box-primary">
                        <div class="box-header">
                            <h3 class="box-title">电影列表</h3>
                            <div class="box-tools">
                                <div class="input-group input-group-sm" style="width: 150px;">
                                    <input type="text" name="table_search" class="form-control pull-right"
                                           placeholder="请输入关键字...">

                                    <div class="input-group-btn">
                                        <button type="submit" class="btn btn-default"><i class="fa fa-search"></i>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="box-body table-responsive no-padding">
                            {% include 'admin/flash_msg.html' %}
                            <table class="table table-hover">
                                <tbody>
                                <tr>
                                    <th>编号</th>
                                    <th>片名</th>
                                    <th>片长</th>
                                    <th>标签</th>
                                    <th>地区</th>
                                    <th>星级</th>
                                    <th>播放数量</th>
                                    <th>评论数量</th>
                                    <th>上映时间</th>
                                    <th>操作事项</th>
                                </tr>
                                {% for movie in movies.items %}
                                <tr>
                                    <td>{{movie.id}}</td>
                                    <td>{{movie.title}}</td>
                                    <td>{{movie.length}}分钟</td>
                                    <td>{{movie.tag.name}}</td>
                                    <td>{{movie.area}}</td>
                                    <td>{{movie.star}}</td>
                                    <td>{{movie.playnum}}</td>
                                    <td>{{movie.commentnum}}</td>
                                    <td>{{movie.release_time}}</td>
                                    <td>
                                        <a href="{{url_for('admin.movie_edit',id=movie.id)}}" class="label label-success">编辑</a>
                                        &nbsp;
                                        <a href="{{url_for('admin.movie_del',id=movie.id)}}" class="label label-danger">删除</a>
                                    </td>
                                </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>
                        <div class="box-footer clearfix">
                         {{pg.render_pagination(movies,'admin.movie_list')}}
                        </div>
                    </div>
                </div>
            </div>
        </section>
{% endblock %}
{% block script %}
<script>
    $(function () {
        $('#g-3').addClass('active');
        $('#g-3-2').addClass('active')
    })
</script>
{% endblock %}